package com.business.java2cache.memcache;

import com.business.java2cache.core.Cache;
import com.business.java2cache.core.CacheProvider;
import com.business.java2cache.util.CacheException;

import java.util.Properties;

/**
 */
public class MemcacheProvider implements CacheProvider {
    public String name() {
        return "memcache";
    }


    /**
     * Configure the cache
     *
     * @param regionName the name of the cache region
     * @return return cache instance
     * @throws CacheException cache exception
     */
    public Cache buildCache(String regionName) throws CacheException {
        return MemCache.getInstance();
    }

    /**
     * Callback to perform any necessary initialization of the underlying cache implementation
     * during SessionFactory construction.
     *
     * @param props current configuration settings.
     */
    public void start(Properties props) throws CacheException {
        MemCache.getInstance();
    }

    /**
     * Callback to perform any necessary cleanup of the underlying cache implementation
     * during SessionFactory.close().
     */
    public void stop() {

    }
}
